package com.vfd.collections.iterartors {
	import com.vfd.collections.iterartors.Iterator
	/**
	* ...
	* @author Default
	*/
	public class XMLListIterator extends Iterator {
		
		public function XMLListIterator(items:XMLList, loop:Boolean = false) {
			super(items, loop);
		}
		/**
		 * Overide constrain index from iterator since XMLList objects use a function call
		 * to get the length as opposed to the Array's length property. e.g, XMLList.length() vs. Array.length
		 */
		protected override function constrainIndex():void {
		
			if(this._loop)
		{
			if(this._index < 0)
			{
				this._index = this._items.length() - 1;
			}
			else if(this._index >= this._items.length())
			{
				this._index = 0;
			}
		}
		else
		{
			if(this._index < 0)
			{
				this._index = 0;
			}
			else if(this._index >= this._items.length())
			{
				this._index = this._items.length() - 1;
			}
		}
		
	}
		
	}
	
}